#ifndef __GS_ARRAY_H__
#define __GS_ARRAY_H__

#include <stdlib.h>
#include <string.h>

typedef struct Array {
  int length;
  int capacity;
  void** data;
} Array;

typedef struct ArrayIterator {
  Array* array;
  int index;
  void** (*next)(struct ArrayIterator* itr);
  void (*reset)(struct ArrayIterator* itr);
} ArrayIterator;


Array* ArrayCreate(int capacity);
void ArrayDestroy(void* data);
int ArrayInsert(Array* array, int index, void* item);
void* ArrayRemoveByIndex(Array* array, int index);
void* ArrayRemove(Array* array, void* item);
int ArrayPushBack(Array* array, void* item);
void* ArrayPopBack(Array* array);

ArrayIterator ArrayGetIterator(Array* array);

#endif

